package route

import (
	"github.com/gin-gonic/gin"
	"github.com/vueadmin/app/api/internal/handler/link"
	"github.com/vueadmin/app/api/internal/svc"
	"github.com/vueadmin/middleware"
	"github.com/vueadmin/utils/conv"
)

type Link struct{}

/**
 * @description(友情链接路由)
 * @buildcode(true)
*/
func (Link) RegisterRoute(route *gin.Engine, svcCtx *svc.ServiceContext) {
	r := route.Group(svcCtx.Config.Prefix)
	r.POST("/Link/index", func(c *gin.Context) {link.GetPageList(c, svcCtx)})               //数据列表
	r.POST("/Link/add" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {link.Add(c, svcCtx)})               //添加
	r.POST("/Link/update" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {link.Update(c, svcCtx)})               //修改
	r.POST("/Link/delete" ,middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), func(c *gin.Context) {link.Delete(c, svcCtx)})               //删除
	r.POST("/Link/detail", func(c *gin.Context) {link.Detail(c, svcCtx)})               //查看详情
}

